

import 'package:chatbot/model/completion_model.dart';

class CreatorListModel {
  late int code;
  late DataBean data;
  late String message;

  static CreatorListModel fromMap(Map<String, dynamic> map) {
    CreatorListModel creatorListModelBean = CreatorListModel();
    creatorListModelBean.code = map['code'];
    creatorListModelBean.data = DataBean.fromMap(map['data']);
    creatorListModelBean.message = map['message'];
    return creatorListModelBean;
  }

  Map toJson() => {
    "code": code,
    "data": data,
    "message": message,
  };
}



class DataBean {
  late int endRow;
  late bool hasNextPage;
  late bool hasPreviousPage;
  late bool isFirstPage;
  late bool isLastPage;
  late List<Creator> list;
  late int navigateFirstPage;
  late int navigateLastPage;
  late int navigatePages;
  late int nextPage;
  late int pageNum;
  late int pageSize;
  late int pages;
  late int prePage;
  late int size;
  late int startRow;
  late int total;

  static DataBean fromMap(Map<String, dynamic> map) {
    DataBean dataBean = DataBean();
    dataBean.endRow = map['endRow'];
    dataBean.hasNextPage = map['hasNextPage'];
    dataBean.hasPreviousPage = map['hasPreviousPage'];
    dataBean.isFirstPage = map['isFirstPage'];
    dataBean.isLastPage = map['isLastPage'];
    dataBean.list = []..addAll(
      (map['list'] as List ?? []).map((o) => Creator.fromMap(o))
    );
    dataBean.navigateFirstPage = map['navigateFirstPage'];
    dataBean.navigateLastPage = map['navigateLastPage'];
    dataBean.navigatePages = map['navigatePages'];

    dataBean.nextPage = map['nextPage'];
    dataBean.pageNum = map['pageNum'];
    dataBean.pageSize = map['pageSize'];
    dataBean.pages = map['pages'];
    dataBean.prePage = map['prePage'];
    dataBean.size = map['size'];
    dataBean.startRow = map['startRow'];
    dataBean.total = map['total'];
    return dataBean;
  }

  Map toJson() => {
    "endRow": endRow,
    "hasNextPage": hasNextPage,
    "hasPreviousPage": hasPreviousPage,
    "isFirstPage": isFirstPage,
    "isLastPage": isLastPage,
    "list": list,
    "navigateFirstPage": navigateFirstPage,
    "navigateLastPage": navigateLastPage,
    "navigatePages": navigatePages,
    "nextPage": nextPage,
    "pageNum": pageNum,
    "pageSize": pageSize,
    "pages": pages,
    "prePage": prePage,
    "size": size,
    "startRow": startRow,
    "total": total,
  };
}
